Skip to content

feat: add OpenSearch resource type#9

Open
revied wants to merge 5 commits intoblock:mainfrom
revied:feature/opensearch-resource-type
Open

feat: add OpenSearch resource type#9
revied wants to merge 5 commits intoblock:mainfrom
revied:feature/opensearch-resource-type

Conversation

@revied
Copy link
Copy Markdown
Contributor

@revied revied commented Apr 13, 2026

Summary

  • Adds OpenSearch as a supported resource type for version drift detection
  • Implements Wiz inventory source, endoflife.date EOL provider support, and detector
  • Fixes convertCycle to correctly handle two-tier lifecycle (standard support -> extended support -> EOL) for products like OpenSearch and EKS

Changes

EOL Provider (pkg/eol/endoflife/)

  • Add opensearch -> amazon-opensearch ProductMapping
  • Add version normalization: strip OpenSearch_ prefix, truncate to major.minor
  • Fix convertCycle: versions past eol but before extendedSupport are now correctly classified as extended support (YELLOW) instead of EOL (RED)

Wiz Inventory Source (pkg/inventory/wiz/opensearch.go)

  • Parse Wiz CSV for OpenSearch domains
  • Filter by nativeType (domains only, excludes snapshots/policies)
  • Version prefix stripping (OpenSearch_2.11 -> 2.11)
  • Tag-based service attribution with registry fallback

Detector (pkg/detector/opensearch/)

  • Follows Aurora/EKS pattern: fetch inventory, check EOL, apply policy

Server Wiring (cmd/server/main.go)

  • WIZ_OPENSEARCH_REPORT_ID env var
  • Inventory source, EOL provider, and detector registration

Test plan

  • go build ./... passes
  • go test ./... passes (53+ tests including 13 new OpenSearch tests)
  • EOL lifecycle correctly classifies: supported, extended support, and EOL versions
  • Wiz inventory source filters to domain resources only
  • Version normalization handles OpenSearch_2.11, 2.11.0, 2.11 formats

🤖 Generated with Claude Code

@revied revied requested a review from bakayolo as a code owner April 13, 2026 17:18
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 77.58621% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/inventory/wiz/opensearch.go 66.00% 16 Missing and 1 partial ⚠️
pkg/detector/opensearch/detector.go 84.00% 5 Missing and 3 partials ⚠️
pkg/eol/mock/provider.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
pkg/eol/endoflife/provider.go 86.74% <100.00%> (ø)
pkg/eol/mock/provider.go 0.00% <0.00%> (ø)
pkg/detector/opensearch/detector.go 84.00% <84.00%> (ø)
pkg/inventory/wiz/opensearch.go 66.00% <66.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/inventory/wiz/opensearch.go Outdated
@Kiran01bm
Copy link
Copy Markdown
Contributor

also worth updating the Supported Resources section of the README

revied and others added 4 commits April 15, 2026 09:46
Adds full OpenSearch support across the detection pipeline:

- EOL provider: add ProductMapping for amazon-opensearch, version
  normalization (strip OpenSearch_ prefix, truncate to major.minor),
  and fix convertCycle to correctly handle two-tier lifecycle where
  eol = end of standard support and extendedSupport = real EOL
- Wiz inventory source: CSV parsing for OpenSearch domains with
  nativeType filtering (domains only, not snapshots/policies),
  version prefix stripping, and tag-based service attribution
- Detector: follows Aurora/EKS pattern for inventory fetch, EOL
  check, and policy evaluation
- Server wiring: WIZ_OPENSEARCH_REPORT_ID config, inventory source,
  EOL provider, and detector registration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follows the Aurora/EKS pattern with full-flow tests covering all
status classifications (RED, YELLOW, GREEN) and summary statistics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address review feedback to leverage the shared CSV parsing infrastructure
instead of duplicating the column-index logic. Also updates README with
currently supported resource types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@revied revied force-pushed the feature/opensearch-resource-type branch from 8f11445 to 60b96bb Compare April 15, 2026 13:51
Mark ElastiCache and OpenSearch as implemented (✅) in the architecture
docs, add opensearch.go and helpers.go to the repo structure diagram,
and list all four inventory source implementations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@revied
Copy link
Copy Markdown
Contributor Author

revied commented Apr 15, 2026

Done — updated the Supported Resources section in README.md (ElastiCache and OpenSearch moved from "Easily extensible to" into "Currently implemented"). Also updated ARCHITECTURE.md to mark both as ✅ and added opensearch.go, helpers.go, and the opensearch detector to the repo structure diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants